/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pruebawallayllu;

import BESA.ExceptionBESA;
import co.edu.javeriana.ayllu.agents.representativeagent.RepresentativeAgent;
import co.edu.javeriana.ayllu.agents.representativeagent.RepresentativeAgentState;
import co.edu.javeriana.ayllu.agents.sessionmanageragent.SessionManagerAgent;
import co.edu.javeriana.ayllu.agents.sessionmanageragent.SessionManagerAgentState;
import co.edu.javeriana.ayllu.directories.user.UserDirectory;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Ayllu
 */
public class CreadorUsuariosWall {
    //1 Presentador 6 estudiantes

    public static void crearEjemplo() {
        UserDirectory dir = UserDirectory.getInstance();
        RepresentativeAgentState raState;
        RepresentativeAgent ra;
        SessionManagerAgentState smaState;
        SessionManagerAgent sma;
        dir.addHability("Presentador");
        dir.addHability("Aprendiz");
        dir.addHability("Agrupador");
        dir.addHability("Participante");
        //Presentador
        raState = new RepresentativeAgentState();
        raState.addAnswer("Presentador", "OK");
        raState.addAnswer("Agrupador", "OK");
        
        try {
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Profe", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));          
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Profe", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Presentador", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Agrupador", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            //Aprendiz
            raState = new RepresentativeAgentState();
            raState.addAnswer("Aprendiz", "OK");
            raState.addAnswer("Participante", "OK");
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Juan", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Juan", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Aprendiz", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Participante", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            //Aprendiz/*
            raState = new RepresentativeAgentState();
            raState.addAnswer("Aprendiz", "OK");
            raState.addAnswer("Participante", "OK");
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Maria", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Maria", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Aprendiz", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Participante", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            //Aprendiz
            raState = new RepresentativeAgentState();
            raState.addAnswer("Aprendiz", "OK");
            raState.addAnswer("Participante", "OK");
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Luna", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Luna", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Aprendiz", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Participante", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            //Aprendiz
            raState = new RepresentativeAgentState();
            raState.addAnswer("Aprendiz", "OK");
            raState.addAnswer("Participante", "OK");
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Carlos", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Carlos", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Aprendiz", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Participante", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            //Aprendiz
            raState = new RepresentativeAgentState();
            raState.addAnswer("Aprendiz", "OK");
            raState.addAnswer("Participante", "OK");
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Francisco", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Francisco", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Aprendiz", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Participante", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            //Aprendiz
            raState = new RepresentativeAgentState();
            raState.addAnswer("Aprendiz", "OK");
            raState.addAnswer("Participante", "OK");
            RepresentativeAgent.prepareInstance();
            ra = new RepresentativeAgent("RA_Luis", raState, 0.91);
            ra.start();
            smaState = new SessionManagerAgentState(ra.getAdmLocal().getHandlerByAid(ra.getAid()));
            SessionManagerAgent.prepareInstance();
            sma = new SessionManagerAgent("SMA_Luis", smaState, 0.91);
            sma.start();
            dir.addUserToHability("Aprendiz", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
            dir.addUserToHability("Participante", sma.getAdmLocal().getHandlerByAid(sma.getAid()));
        } catch (ExceptionBESA io) {
            Logger.getLogger(CreadorUsuariosWall.class.getName()).log(Level.SEVERE,null,io);
        }

    }
}
